home *** CD-ROM | disk | FTP | other *** search
- /*****************************************************************************
- * *
- * ARexx script: ProAsmSubfile.ced v1.02 for the ProAsm Assembler *
- * *
- * This script assembles the source given by the first line of the actual *
- * view, if no such source file is given the contents of the actual view will *
- * be assembled. *
- * *
- * The ';$ <filename><LF>' string in the first line defines the source file *
- * which is to be assembled. This enables you to assemble the main file out *
- * of a loaded include file. *
- * *
- * by Daniel Weber *
- * 28.Jul.93 *
- * *
- * *
- * Usage: ProAsmSubfile.ced *
- * *
- * *
- * How to run: *
- * *
- * 1) Activate the view of the source file. *
- * 2) Start this ARexx script via 'Send DOS/ARexx command...' *
- * *
- *****************************************************************************/
-
- editorID = 'CygnusEd' /* define editor ID */
-
- OPTIONS RESULTS
-
- ADDRESS 'rexx_ced' /* get some information from the CED */
- status 15
- fileadr = result /* file address of actual view */
- status 19
- name = result /* complete path and filename */
- status 57
- oldline = result /* current line numer */
-
- 'Beg Of File' /* ensure file is updated */
-
- status 55 /* get contents of the first line */
- PARSE VAR result ";$ " mainfile '0A'X /* 'main' file definition... */
-
-
- ADDRESS 'asx_rexx'
- FindID editorID':'name
- port = result
- DO WHILE port~=''
- ADDRESS (''||port)
- EndOfAssembly /* quit all open jobs of this source */
- ADDRESS 'asx_rexx'
- FindID editorID':'name
- port = result
- END
-
-
- BegOfAssembly /* begin a new job */
- port = result
-
- IF port~='' THEN DO
- ADDRESS (''||port) /* ARexx weirdness */
- DefineID editorID':'name /* set an ID (optional) */
-
- IF mainfile~='' THEN Assemble mainfile
- ELSE Assemble ADDRESS fileadr
-
- PARSE VAR result . errors . warnings . optims optimbytes . codesize . workspace
-
-
- IF errors~=0 THEN DO /* jump to first error */
- NextError /* get next error */
- errortxt = result
-
- ADDRESS 'rexx_ced'
- IF errortxt ='' THEN DO
- Okay1 'no more errors'
- exit(0)
- END
-
-
- PARSE VALUE errortxt WITH 1 LineNumber ' : ' ErrorMsg ' in file ' filename
- IF filename ~='' THEN DO
- status 66
- DO numwins= result-1 TO 1 BY -1 UNTIL UPPER(result) = UPPER(filename)
- next view
- status 21
- END
- IF UPPER(result) ~= UPPER(filename) THEN DO
- split view
- open filename
- END
- END
- Jump To Line LineNumber
- Okay1 ErrorMsg
- END
-
-
- ELSE DO
- stat = codesize 'bytes.' '0A'X''optims 'optimizations saved' optimbytes 'bytes' '0A'X
- stat = stat''errors 'Errors,' warnings 'Warnings,' workspace 'bytes of workspace used.'
-
- ADDRESS 'rexx_ced'
- Jump To Line oldline
- Okay1 "File '"name"'"'0A'X"assembled to" stat
- END
- END
-
- EXIT(0)
-
-